package com.hzw.saas.service.project.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

import java.util.Arrays;

/**
 * @author zzl
 * @since 08/11/2021
 */
@ToString
@AllArgsConstructor
@Getter
public enum FlowType {

    APPLY_PASS("1004", "立项审批通过", "项目成功立项"),
    ACCEPT_PASS("1014", "验收审批通过", "项目验收成功");

    private final String code;
    private final String value;
    private final String description;

    public static String getDescByCode(String code) {
        return Arrays.stream(FlowType.values())
            .filter(it -> it.getCode().equals(code))
            .findFirst()
            .map(FlowType::getDescription)
            .orElse("");
    }
}
